package ca.uvic.cs.cogz.mapping.ui;

import java.awt.BorderLayout;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

public class ReportViewer extends JFrame {
	private static final long serialVersionUID = -1310987232236460125L;

	private JEditorPane reportPane;

	public ReportViewer(String reportHtml) {
		super("Report Viewer");

		init(reportHtml);
	}

	private void init(String reportHtml) {
		reportPane = new JEditorPane();
		reportPane.setContentType("text/html");
		reportPane.setText(reportHtml);

		//System.out.println(((HTMLDocument) reportPane.getDocument()).);

		JScrollPane scrollPane = new JScrollPane(reportPane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

		add(scrollPane, BorderLayout.CENTER);

		setSize(800, 600);
	}
}
